package com.woniu.cq.mallorder.mapper;

import com.woniu.cq.mallorder.domain.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author daniel
 * @since 2020-09-19
 */
public interface OrderMapper extends BaseMapper<Order> {
    @Select("select * from tb_order where user_id = #{userId}")
    List<Order> getAllOrders(Integer userId);
    @Insert("insert into tb_logs(user_id,log_time) values(#{userId},#{now})")
    void addLogs(Integer userId, LocalDateTime now);
}
